package adv11;

import java.io.File;
import java.util.List;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

public class XmlDemo {

	public static void main(String[] args) throws Exception {
		SAXReader reader = new SAXReader();
		Document doc = reader.read(new File("java57.xml"));
		Element root = doc.getRootElement();
		System.out.println(root.getName());
		List<Element> list = root.elements("team");
		for (Element e : list) {
			System.out.print(e.getName());

			System.out.println(",num=" + e.attributeValue("num"));
		}
	}

}
